<!DOCTYPE html>
<html>
<head>
	<title>后台登录</title>
	<script type="text/javascript" src="/bower_components/jquery/dist/jquery.min.js"></script>
	<script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
	<style type="text/css">
		body{
			background-color: #cdf;
		}
		form{
			border-radius: 5%;
			box-shadow: 10px 10px 50px #cef;
			width: 500px;
			background: linear-gradient(to bottom right, #66f ,#3fe4f8, #c7f97f,#f3f61f);
			margin: 100px auto;
			padding: 0px 30px 30px 0px;
		}
		.btn{
			margin-top: 20px;
			margin-right: 20px;
		}
		h1{
			text-align: center;
			padding: 40px 0px;
		}
	</style>
</head>
<body>
	<div class="container">
		<form class="form-horizontal" action="/adminusers/dologin" method="post">
			<h1>管理员登录</h1>
			<div class="form-group">
				<label class="col-xs-3 control-label">用户名：</label>
				<div class="col-xs-9">
					<input type="text" name="user" class="form-control"  placeholder="请输入用户名">
				</div>
			</div>
			<div class="form-group">
				<label for="inputPassword3" class="col-xs-3 control-label">密码：</label>
				<div class="col-xs-9">
					<input type="password" name="password" class="form-control"  placeholder="请输入密码">
				</div>
			</div>
			<div class="form-group">
				<div class="col-xs-offset-3 col-xs-9">
					<button id="submit" type="submit" class="btn btn-success">登录</button>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
	$("#submit").click(function(){	
		$.post("dologin",{
				user:$("input[name='user']").val(),
				password:$("input[name='password']").val()
			},function(response,status){
				if (response=='ok') {
					location.href="/admin";
				}else{
					alert(response);
				}
			})
			return false;
	})
	</script>
</body>
</html>